﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text.RegularExpressions;

using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using LIB;

/// <summary>
/// Summary description for App_Regex
/// </summary>
/// 
namespace LIB
{
    public class App_Regex
    {
        public App_Regex()
        { }

        public static List<string> getStrList(string sRegex, string sInputText)
        {
            List<string> lstResult = new List<string>();
                   
            sInputText =App_String.getHtmlWithFormated(sInputText);
            Match m = Regex.Match(sInputText, sRegex);
            while (m.Success)
            {
                //m.Value, m.Index, m.Length
                lstResult.Add(m.Value);
                m = m.NextMatch();
            }

            return lstResult;
        }

        public static List<string> getStrList(string sRegex, string sInputText,RegexOptions options)
        {
            List<string> lstResult = new List<string>();

            sInputText = App_String.getHtmlWithFormated(sInputText);
            Match m = Regex.Match(sInputText, sRegex, options);
            while (m.Success)
            {
                //m.Value, m.Index, m.Length
                lstResult.Add(m.Value);
                m = m.NextMatch();
            }

            return lstResult;
        }
        
    }
}